# encoding: utf-8
""" 
@version: v1.0 
@author: autumner 
@license: Apache Licence  
@contact: 18322313385@163.com 
@site:  https://gitee.com/autumner/pythoncookbook
@software: PyCharm 
@file: shell_web.py 
@time: 2019/8/2 下午3:42
@note:
通过脚本打开浏览器
"""
import webbrowser

# webbrowser.open('http://www.baidu.com')
# webbrowser.open_new('http://www.163.com')
# webbrowser.open_new_tab('http://www.sina.com')

w = webbrowser.get('firefox')
w.open('http://www.163.com')
w.open_new('http://www.baidu.com')
w.open_new_tab('http://www.sina.com')

# chromePath = r'/opt/google/chrome/chrome'
chromePath = r"/usr/bin/google-chrome-stable"
webbrowser.register('chrome', None, webbrowser.BackgroundBrowser(chromePath))
c = webbrowser.get('chrome')
c.open('http://www.163.com')
c.open_new('http://www.baidu.com')
c.open_new_tab('http://www.sina.com')